// pages/profeSCZP/profeSCZP.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    idzhengurl: 'https://file.91qhkh.com/downloadfile/4710017158/always/mini/idzheng.png',
    idfanurl: 'https://file.91qhkh.com/downloadfile/4710017158/always/mini/idfan.png',
    idshouchiurl: 'https://file.91qhkh.com/downloadfile/4710017158/always/mini/idshouchi.png',
    cardzhengurl: 'https://file.91qhkh.com/downloadfile/4710017158/always/mini/cardzheng.png',
    cardfanurl: 'https://file.91qhkh.com/downloadfile/4710017158/always/mini/cardfan.png',
  },

  upload: function (e) {
    var that = this;
    wx.chooseImage({
      count: 1,
      sizeType: ['original', 'compressed'],
      sourceType: ['camera','album'],
      success(res) {
        // tempFilePath可以作为img标签的src属性显示图片
        const tempFilePaths = res.tempFilePaths;
        switch (e.currentTarget.id){
          case '0':
            that.setData({
              idzhengurl: tempFilePaths
            })
            break;
          case '1':
            that.setData({
              idfanurl: tempFilePaths
            })
            break;
          case '2':
            that.setData({
              idshouchiurl: tempFilePaths
            })
            break;
          case '3':
            that.setData({
              cardzhengurl: tempFilePaths
            })
            break;
          case '4':
            that.setData({
              cardfanurl: tempFilePaths
            })
            break;
        }
      }
    })
  },

  next: function () {
    // wx.showToast({
    //   icon: 'none',
    //   title: '信息填写不完整',
    // })
    wx.navigateTo({
      url: '../profeSCSJ/profeSCSJ',
    })
  },
})